{include file="entete.tpl"}
{literal}
<script type="text/javascript" src= "/PariGest/pages/js/prototype.js"></script>
<script type="text/javascript">
function init()
{
  // charge la barre d'outils
}

function creerSpecif()
{
  $("NewLstTable").show();
}

function cocheDefaut(radio)
{
  for(var cpt = 0; cpt < $F("NbChamps"); cpt++ )
  {
   // alert($("Defaut_"+cpt).checked +" - " + radio.name + " - "+"Defaut_"+cpt);
    var input = "Defaut_"+cpt;
    if( $("Defaut_"+cpt).checked && radio.name != "Defaut_"+cpt )
    { 
      $("Defaut_"+cpt).checked = false;
      break;
    }    
  } 
}

var _prefixeCompte = '';
var _indexCompte = '';
function confirmSupprCompte(prefixe, index)
{
  _prefixeCompte = prefixe;
  _indexCompte = index;
  top.afficheConfirm({methodeYes:supprCompte, titre:'Confirmation', message:'Etes-vous sûr de vouloir supprimer cette valeur ?'});
}

function supprCompte ()
{
  var parametres = 'idCompte=' + $F(_prefixeCompte + "idCompte_" + _indexCompte);
  parametres += '&Action=Del';  
  new Ajax.Request('xmlCompte.php', {
      parameters: parametres
    });
  $(_prefixeCompte + "lg_idCompte_" + _indexCompte).remove();  
  $("NbChamps").value = parseInt($F("NbChamps"))-1;
  if( $F("NbChamps") == 0 )
  {
    creerSpecif();
  }
}

function afficheCommentaire(img, input)
{  
  top.afficheModal();
  top.$('popCommentaire').style.zIndex = "9000";
  top.$('popCommentaire').show();
  top.$('commentaire').value=$F(input);  
  top.$('returnVal').value=input;
  top.$('imgComment').value=img.name;
}


</script>
{/literal}
<body onload="init()" >
<form action="param_compte.php" method="post" style="margin:0">
<input type="hidden" name="Action" id="Action" value="">
{if isset($compte) }
<table style="width:100%;height:100%" border=0 cellspacing=0 cellpadding=0>	
	<tr>
		<td valign=top>
			<table id=LstComptes border=0 >
				<tr>
				  <td></td>
					<td style="width:100%">Libellé</td>
					<td>Solde</td>
					<td>Défaut</td>
					<td>Commentaire</td>
				</tr>
				{foreach from=$compte item=ligne name=compte}
 					{include file='inc/IncCompte.tpl' index=$smarty.foreach.compte.index prefixe="" maLigne=$ligne}
				{/foreach}				
			  <tbody id=NewLstTable style="display:none">
  			  {* Nouvelles lignes *}
          {section name=foo start=0 loop=5 step=1}
            {include file='inc/IncCompte.tpl' index=$smarty.section.foo.index prefixe="N"}
          {/section}
        </tbody>
		  </table>
		<input type=hidden name="NbChamps" id="NbChamps" value="{$NbChamps}">
		</td>
	</tr>
</table>
{if $smarty.foreach.compte.total == 0 }
  {literal}
    <script>creerSpecif();</script>
  {/literal}
{/if}
{/if}
</form>
<body>